/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package datamodel;

import java.io.Serializable;
import java.util.Set;
import javax.persistence.Entity;
import javax.persistence.OneToMany;
import javax.persistence.OrderBy;

/**
 *
 * @author eXtreme
 */
@Entity
public class SystemCustomer extends SystemUser implements Serializable {

    // -----------------------
    private static final long serialVersionUID = 1L;
    @OneToMany(mappedBy = "createdBy")
    @OrderBy("created DESC")
    private Set<Ticket> created;
    // -----------------------

    public SystemCustomer() {
    }

    public SystemCustomer(String name, String surname, String email, String password) {
        this.name = name;
        this.surname = surname;
        this.email = email;
        this.password = password;
    }

    public Set<Ticket> getCreated() {
        return created;
    }

    public void setCreated(Set<Ticket> created) {
        this.created = created;
    }
    
    @Override
    public String toString() {
        return getName() + " " + getSurname();
    }

    @Override
    public String getRole() {
        return "Zákazník";
    }
}
